package roborally.script;

import roborally.model.Robot;
import be.kuleuven.cs.som.annotate.*;
import be.kuleuven.cs.som.taglet.*;

/**
 * @author Joren VERSPEURT
 * @author Mathieu REYMOND
 * @version 3.0
 * 
 * The superclass for all conditional composed commands possible in RoboRally. This includes While and If.
 */
public abstract class ConditionalCommand extends ComposedCommand{
	
	/**
	 * Create a new ConditionalCommand with a given Robot, a Condition and a number of sub-Commands.
	 * @param robot The Robot this Command will apply to.
	 * @param condition The Condition that applies to this ConditionalCommand.
	 * @param commands The Commands this ComposedCommand will be composed of.
	 */
	protected ConditionalCommand(Robot robot, Condition condition, Command... commands){
		super(robot, commands);
		this.condition = condition;
	}
	
	/**
	 * The Condition that applies to this ConditionalCommand.
	 */
	protected final Condition condition;
	
	/**
	 * Returns the Condition that applies to this ConditionalCommand.
	 */
	@Basic @Immutable
	public Condition getCondition() {
		return condition;
	}

}
